feat(frontend): implement comprehensive multi-language support (REQ-0018)#27
feat(frontend): implement comprehensive multi-language support (REQ-0018)#27
Conversation
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: daf39231bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
frontend/scripts/setup-locales.js
Outdated
| import fs from "fs"; | ||
| import path from "path"; | ||
|
|
||
| const sourcePath = path.join(process.cwd(), "src/i18n/locales/en.json"); |
There was a problem hiding this comment.
Point locale generator at an existing source file
The locale setup script now reads from src/i18n/locales/en.json, but that file was removed in this same change, so running node scripts/setup-locales.js crashes with ENOENT before generating any locale files. This breaks the maintenance workflow for regenerating/updating translations and should be switched to a path that still exists (for example the committed English translation under public/locales/en/translation.json) or by restoring the source file.
Useful? React with 👍 / 👎.
| .init({ | ||
| fallbackLng: 'en', | ||
| supportedLngs: ['en', 'ar', 'hi', 'es', 'fr', 'bn', 'pt', 'id', 'ru', 'de', 'ja', 'tr', 'vi', 'it', 'pl', 'uk', 'nl', 'el', 'hu', 'sv', 'cs'], |
There was a problem hiding this comment.
Restrict i18next loading to language-only locale codes
This init block enables browser locale detection but leaves i18next at its default load: 'all' behavior; for common regional locales like en-US/pt-BR, i18next will try /locales/<region>/translation.json before falling back to /locales/<base>/translation.json. Since only base-language folders are shipped, each affected startup incurs a guaranteed missing-locale request (and can lengthen the Suspense loading state). Add load: 'languageOnly' (or provide regional files) to avoid the repeated misses.
Useful? React with 👍 / 👎.
|
Addressed the review feedback in commit a6546ae:\n\n1) now reads from (existing source), so locale regeneration no longer fails with ENOENT.\n2) now sets to prevent unnecessary regional-locale fetch misses (e.g. , ).\n\nI also re-ran successfully. |
|
Follow-up (clean summary): fixed both review points in commit a6546ae.
|
Objective
Implemented comprehensive language support for the application fulfilling REQ-0018.
Changes Made
i18next-http-backendandi18next-browser-languagedetectorallowing native dynamic translations for 21 new languages without increasing bundle weight.<LanguageSwitcher />component gracefully integrated viaSuspenseand placed into theLandingPageandListPage.document.documentElement.dir = 'rtl'based on the selected language, establishing layout stability for Arabic.--accept-langChrome pref mocking), UI behavior stability, and refactored older brittle E2E bindings replacing textual.click()with standard DOMdata-testidstrategies.Note: E2E Tests verify UI locale states consistently.